package com.nativetalk.dao;

import com.nativetalk.base.Page;
import com.nativetalk.bean.comment.TdNtCommentPage;
import com.nativetalk.bean.reserve.TdNtReserveInsert;
import com.nativetalk.bean.reserve.TdNtReserveMemberList;
import com.nativetalk.bean.reserve.TdNtReserveTeacherList;
import com.nativetalk.dto.RecentlyAppointmentResponse;
import com.nativetalk.dto.UpcomingResponse;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;

/**
 * Created by lizhun on 16/6/15.
 * Modified by wangzheng on 17/02/15
 */
@MyBatisRepository
public interface TdNtReserveDao {
    /**
     * @Purpose  添加预约
     * @version  3.0
     * @author   lizhun
     * @param    tdNtReserveInsert
     * @return   void
     */
    public void insertTdNtReserve(@Param("pojo") TdNtReserveInsert tdNtReserveInsert);
    /**
     * @Purpose  更新预约状态
     * @version  3.0
     * @author   lizhun
     * @param    tdNtReserveInsert
     * @return   void
     */
    public void updateTdNtReserve(TdNtReserveInsert tdNtReserveInsert);
    /**
     * @Purpose  查找学生已完成预约数量
     * @version  3.0
     * @author   lizhun
     * @param    page
     * @return   int
     */
    public int findTdNtReserverByFinishMembId(Page page);
    /**
     * @Purpose  分页查找学生已完成预约
     * @version  3.0
     * @author   lizhun
     * @param    page
     * @return   List<TdNtReserveMemberList>
     */
    public List<TdNtReserveMemberList> findTdNtReserverByFinishMembIdPage(Page page);
    /**
     * @Purpose  查找学生未完成预约数量
     * @version  3.0
     * @author   lizhun
     * @param    page
     * @return   int
     */
    public int findTdNtReserverByUnFinishMembId(Page page);
    /**
     * @Purpose  分页查找学未已完成预约
     * @version  3.0
     * @author   lizhun
     * @param    page
     * @return   List<TdNtReserveMemberList>
     */
    public List<TdNtReserveMemberList> findTdNtReserverByUnFinishMembIdPage(Page page);
    /**
     * @Purpose  查找老师完成预约数量
     * @version  3.0
     * @author   lizhun
     * @param    page
     * @return   int
     */
    public int findTdNtReserverByFinishTeaId(Page page);
    /**
     * @Purpose  分页查找老师完成预约
     * @version  3.0
     * @author   lizhun
     * @param    page
     * @return   List<TdNtReserveTeacherList>
     */
    public List<TdNtReserveTeacherList> findTdNtReserverByFinishTeaIdhPage(Page page);
    /**
     * @Purpose  查找老师未完成预约数量
     * @version  3.0
     * @author   lizhun
     * @param    page
     * @return   int
     */
    public int findTdNtReserverByUnFinishTeaId(Page page);
    /**
     * @Purpose  分页查找老师未完成预约
     * @version  3.0
     * @author   lizhun
     * @param    page
     * @return   List<TdNtReserveTeacherList>
     */
    public List<TdNtReserveTeacherList> findTdNtReserverByUnFinishTeaIdhPage(Page page);
    /**
     * @Purpose  根据预约id查找预约信息
     * @version  3.0
     * @author   lizhun
     * @param    reserve_id
     * @return   TdNtReserveInsert
     */
    public TdNtReserveInsert findTdNtReserverById(int reserve_id);

    /**
     * @Purpose  查找老师当前时间段是否可预约
     * @version  3.1
     * @author   lizhun
     * @param    map
     * @return   TdNtReserveInsert
     */
    public TdNtReserveInsert findTdNtReserverConflict(Map<String, Object> map);

    /**
     * @Purpose  查找用户当前时间段是否预约了其他老师
     * @version  4.1
     * @author   wangzheng
     * @param    map
     * @return   TdNtReserveInsert
     */
    public TdNtReserveInsert findTdNtMemberReserveConflict(Map<String, Object> map);

    /**
     * @Purpose  查找用户是否预约过体验预约
     * @version  4.0
     * @author   lizhun
     * @param    memb_id
     * @return   TdNtReserveInsert
     */
    public TdNtReserveInsert findTdNtReserver(int memb_id);

    /**
     * @Purpose  根据课程查找用户是否试听过该课
     * @version  4.1
     * @author   wangzheng
     * @param    map
     * @return   TdNtReserveInsert
     */
    public TdNtReserveInsert findTdNtReserverByCouId(Map<String, Object> map);

    /**
     * @Purpose  根据用户购买规格套餐的id查找已上完课的次数
     * @version  4.1
     * @author   wangzheng
     * @param    memb_set_id
     * @return   int
     */
    public int findFinishedSizeByMembSetId(int memb_set_id);

    public UpcomingResponse findUpcomingByMembId(Integer memb_id);

    RecentlyAppointmentResponse findRecentlyAppointment(Integer tea_id);

    /**
     * 跳转课程页所需数据
     * @param reserve_id
     * @return
     */
    public TdNtCommentPage findCommentById(Integer reserve_id);

    /**
     * 查询预约信息评价用
     * @param reserve_id
     * @return
     */
    public TdNtCommentPage findReserverById(int reserve_id);

    /**
     * 修改老师评论状态
     * @param reserve_id
     * @param tea_is_comment
     */
    public Integer updateTeaIsComment(@Param("tea_is_comment") int tea_is_comment,@Param("reserve_id") int reserve_id);

    /**
     * 修改学生评论状态
     * @param reserve_id
     * @param student_is_comment
     */
    public Integer updateStuIsComment(@Param("student_is_comment") int student_is_comment,@Param("reserve_id") int reserve_id);

    /**
     * 查看是否是体验课
     * @param reserve_id
     * @return
     */
    public Integer selectIsTrialById(Integer reserve_id);

}
